﻿using RedmineTypes = Redmine.Net.Api.Types;

namespace Redmine.Laptop.API.Models
{
    public class TimeEntryActivity
    {
        public int TimeEntryActivityID { get; set; }
        public bool IsDefault { get; set; }
        public string Name { get; set; }

        public static explicit operator RedmineTypes::TimeEntryActivity(TimeEntryActivity timeEntryActivity)
        {
            return new RedmineTypes::TimeEntryActivity
            {
                Id = timeEntryActivity.TimeEntryActivityID,
                IsDefault = timeEntryActivity.IsDefault,
                Name = timeEntryActivity.Name
            };
        }

        public static explicit operator TimeEntryActivity(RedmineTypes::TimeEntryActivity timeEntryActivity)
        {
            return new TimeEntryActivity
            {
                TimeEntryActivityID = timeEntryActivity.Id,
                IsDefault = timeEntryActivity.IsDefault,
                Name = timeEntryActivity.Name
            };
        }
    }
}
